package TI;

import java.util.List;

import Exceptions.ProductSalesPriceNeverSetException;
import Magnitudes.Money;
import Magnitudes.Pesos;

public class Account {
	
	
	private List<Sale> sales;
	private Money amount;
	
	
	
	public List<Sale> getSales(){
		return this.sales;
	}
	
	
	public Money getAmount(){
		return this.amount;
	}
	
	
	// devuelve el monto total de las ventas
	public Money indebtendness() throws ProductSalesPriceNeverSetException{
		double monto = 0;
		if(this.getSales().size() == 0){
			return (new Pesos(monto));
		}else{
			for(Sale sale: sales){
				monto = monto + sale.amount().amount();
			}
		}
		return (new Pesos(monto));
	}
	
	

}
